home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / M / Microphone Quotes / Quotes - Historical < prev   
Encoding:
Text File  |  1991-04-19  |  5.7 KB  |  184 lines  |  [TEXT/ttxt]

  1.  Settings File = GEnie
  2.  Script Name = Quotes - Historical
  3.  Command Key = U
  4.  F-Key = 
  5.  Menu = YES
  6.  Button = NO
  7.  Version = 3007
  8.  System = Macintosh
  9.  
  10. 1   Remark "Microphone II Script to download historical quotes from GEnie"
  11. 2   Remark ""
  12. 3   Remark "This script requests up to 52 weeks of weekly data for the stocks you request."
  13. 4   Remark "It is intended for stocks that you are adding to your Market Charter stack."
  14. 5   Remark "It creates a file for each stock you request to import into the stock's chart."
  15. 6   Remark ""
  16. 7   Remark "Requires the script 'Ask Date'"
  17. 8   Remark ""
  18. 9   Remark "Written by Melvyn D. Magree, (M)agreeable software, inc."
  19. 10  Remark "For use with Market Charterâ„¢, a HyperCard® stack published by"
  20. 11  Remark ""
  21. 12  Remark "   Survivor Software Ltd."
  22. 13  Remark "   11222 La Cienega Blvd., Suite 450"
  23. 14  Remark "   Inglewood CA 90304"
  24. 15  Remark "   (213) 410-9527"
  25. 16  Remark ""
  26. 17  Remark "Latest update of this script - 91-04-19"
  27. 18  Remark ""
  28. 19  Set Variable * MaxWait from Expression "60"
  29. 20  Set Variable * StartEnd from Expression "'Start'"
  30. 21  Do Script * "'Ask Date'"
  31. 22  If Expression "GivenDate<>''"
  32. 23   Set Variable * StartDate from Expression "GivenDate"
  33. 24  Else
  34. 25   Abort Script
  35. 26  End If
  36. 27  Set Variable * StartEnd from Expression "'End'"
  37. 28  Do Script * "'Ask Date'"
  38. 29  Set Variable * EndDate from Expression "GivenDate"
  39. 30  Set Variable * i from Expression "0"
  40. 31  Set Variable * Symbol from Expression "'x'"
  41. 32  While Expression "Symbol<>''"
  42. 33   Set Variable * Symbol from Dialog Box "'Enter Stock Symbol (blank to end)^M'"
  43. 34   If Expression "Symbol<>''"
  44. 35    Set Variable * i from Expression "i+1"
  45. 36    Set Variable * SymbolList[i] from Expression "Symbol"
  46. 37   End If
  47. 38  End While
  48. 39  If Expression "not Exists(SymbolList)"
  49. 40   Abort Script
  50. 41  End If
  51. 42  If Expression "false"
  52. 43   Set Variable * UserID from Dialog Box "'Enter GEnie Account Number'"
  53. 44  Else
  54. 45   Do Script * "'Check Profile'"
  55. 46   If Expression "UserID=''"
  56. 47    Abort Script
  57. 48   End If
  58. 49  End If
  59. 50  If Expression "false"
  60. 51   Set Variable * Password from Dialog Box (prot.) "'Enter your password'"
  61. 52  Else
  62. 53   If Expression "Password=''"
  63. 54    Abort Script
  64. 55   End If
  65. 56  End If
  66. 57  Dial Service * "'GEnie'"
  67. 58  If Failure
  68. 59   Abort Script
  69. 60  End If
  70. 61  Send Text String "'H'"
  71. 62  Wait Seconds "1"
  72. 63  Send Text String "'H'"
  73. 64  Wait Seconds "1"
  74. 65  Send Text String "'H'"
  75. 66  When Text Equals "'U#='"
  76. 67   Send Text String "UserID&','&Password&'^M'"
  77. 68  Or When Seconds Have Passed "30"
  78. 69   Hang Up
  79. 70   Abort Script
  80. 71  End When
  81. 72  When Text Equals "'continue?'"
  82. 73  Or When Text Equals "'Reenter U#'"
  83. 74   Hang Up
  84. 75   Abort Script
  85. 76  Or When Seconds Have Passed "MaxWait"
  86. 77   Hang Up
  87. 78   Abort Script
  88. 79  End When
  89. 80  Set Variable * started from Expression "TickCount"
  90. 81  Set Term Param Local Echo Yes
  91. 82  Send Text String "'quotes^M'"
  92. 83  When Text Equals "'<H>elp?'"
  93. 84  Or When Text Equals "'P 780?'"
  94. 85  Or When Seconds Have Passed "MaxWait"
  95. 86   Chain to Script "'Sign Off'"
  96. 87  End When
  97. 88  Send Text String "'1^M'"
  98. 89  Wait for Text "'oice?'"
  99. 90  Send Text String "'4^M'"
  100. 91  Wait for Text "'HELP'"
  101. 92  Wait for Text "'Specifier?'"
  102. 93  Set Variable * i from Expression "0"
  103. 94  While Expression "i<ListSize(SymbolList)"
  104. 95   Set Variable * i from Expression "i+1"
  105. 96   Dialog Install "'Requesting '&SymbolList[i]"
  106. 97   Send Text String "'t='&SymbolList[i]&'^M'"
  107. 98   When Text Equals "'Y/N)?'"
  108. 99    Send Text String "'y^M'"
  109. 100  Or When Text Equals "'No matching issues found'"
  110. 101   Send Local to Screen "'^M'"
  111. 102   Wait for Text "'Specifier?'"
  112. 103   Cycle
  113. 104  Or When Seconds Have Passed "MaxWait"
  114. 105   Hang Up
  115. 106   Abort Script
  116. 107  End When
  117. 108  When Text Equals "'<D>ividends?'"
  118. 109   Send Text String "'i^M'"
  119. 110  Or When Seconds Have Passed "MaxWait"
  120. 111   Hang Up
  121. 112   Abort Script
  122. 113  End When
  123. 114  Wait for Text "'<W>eekly?'"
  124. 115  Send Text String "'w^M'"
  125. 116  When Text Equals "'Date?'"
  126. 117   Send Text String "StartDate&'^M'"
  127. 118  End When
  128. 119  When Text Equals "'Date?'"
  129. 120   Send Text String "EndDate&'^M'"
  130. 121  Or When Text Equals "'No weekly history available'"
  131. 122   Send Local to Screen "'^M'"
  132. 123   Wait for Text "'Specifier?'"
  133. 124   Cycle
  134. 125  End When
  135. 126  When Text Equals "'Continue?'"
  136. 127   Send Text String "'2^M'"
  137. 128  End When
  138. 129  Wait for Text "'inue?'"
  139. 130  Send Text String "'5^M'"
  140. 131  Wait for Text "'inue?'"
  141. 132  Send Text String "'^M'"
  142. 133  Wait for Text "'Y/N)?'"
  143. 134  Send Text String "'y^M'"
  144. 135  File * Open "SymbolList[i]"
  145. 136  If Success
  146. 137   File * Set EOF "SymbolList[i] , 0"
  147. 138  Else
  148. 139   Dialog Update "'File for '&SymbolList[i]&' could not be opened.'"
  149. 140   Wait for Text "'Specifier?'"
  150. 141   Leave
  151. 142  End If
  152. 143  Dialog Install "'Downloading '&SymbolList[i]"
  153. 144  Set Variable * EndOfData from Expression "False"
  154. 145  Repeat
  155. 146   When Text in Stream is "'^M'"
  156. 147    Set Variable * currentLine from Expression "TheLine(CursorRow)"
  157. 148    If Expression "length(currentLine)>6"
  158. 149     File * Write "SymbolList[i] , currentLine&'^M'"
  159. 150    Else If Expression "length(currentLine)=0"
  160. 151     Remark "Ignore preceding blank line"
  161. 152    Else
  162. 153     Remark "Line with SPACE-RETURN is end of data"
  163. 154     Set Variable * EndOfData from Expression "True"
  164. 155    End If
  165. 156   Or When Seconds Have Passed "2*MaxWait"
  166. 157    Remark "Response is too slow.  Quit!"
  167. 158    File * Close "SymbolList[i]"
  168. 159    Hang Up
  169. 160    Abort Script
  170. 161   End When
  171. 162  Until Expression "EndOfData"
  172. 163  File * Close "SymbolList[i]"
  173. 164  Wait for Text "'Specifier?'"
  174. 165 End While
  175. 166 Dialog Discard 
  176. 167 Send Text String "'quit^M'"
  177. 168 When Text Equals "'<H>elp?'"
  178. 169 Or When Text Equals "'P 780?'"
  179. 170 Or When Seconds Have Passed "MaxWait"
  180. 171  Hang Up
  181. 172  Abort Script
  182. 173 End When
  183. 174 Chain to Script "'Sign Off'"
  184.